package Java攻略._3_流式操作._3_利用reduce方法实现归约操作;

import java.util.stream.IntStream;

public class _18_在求和过程中将值增加一倍 {

    public static void main(String[] args) {

        int sum = IntStream.rangeClosed(1, 10)
                .reduce((x, y) -> x + 2 * y)
                .orElse(0);

        System.out.println(sum);
    }
}
